Anything that can go wrong will go wrong
(and at the worst possible time)
Any feature that is not tested is broken.
Any feature that is tested manually is broken the moment changes are made
(anywhere in the code)
Test legacy code for inverse sqrt
float Q_rsqrt( float number )
{
long i; float x2, y; const float threehalfs = 1.5F;
x2 = number * 0.5F;
y = number;
// evil floating point bit level hacking
i = * ( long * ) &y;
// wtf?
i = 0x5f3759df - ( i >> 1 );
y = * ( float * ) &i;
y = y * ( threehalfs - ( x2 * y * y ) ); // 1st iteration
// y = y * ( threehalfs - ( x2 * y * y ) ); // 2nd iteration
return y;
}Unit test: Testing individual units (e.g. inverse sqrt method)
134 unit tests in setfos kernel + GUI tests